package com.example.serviceImpl;


import com.example.bean.Book;
import com.example.bean.Collect;
import com.example.mapper.CollectMapper;
import com.example.service.CollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CollectServiceImpl implements CollectService {


    @Autowired
    private CollectMapper collectMapper;

    @Override
    public List<Book> selectBookByUserId(int userId) {
        return collectMapper.selectBookByUserId(userId);
    }

    @Override
    public int selectBookCollected(String bookId) {
        return collectMapper.selectBookCollected(bookId);
    }
    @Override
    public Collect judgeUserCollect(int userId, String bookId){
        return collectMapper.judgeUserCollect(userId,bookId);
    }

    @Override
    public int insertCollect(int userId, String bookId) {
        return collectMapper.insertCollect(userId, bookId);
    }

    @Override
    public int deleteCollect(int userId, String bookId) {
        return collectMapper.deleteCollect(userId, bookId);
    }


}
